package com.example;
import com.example.config.AppConfig;
import com.example.service.ScheduledTaskService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class MainApp {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(AppConfig.class);
        ScheduledTaskService taskService = context.getBean(ScheduledTaskService.class);
        taskService.startScheduledTasks();
        try {
            Thread.sleep(65000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        taskService.shutdown();
        context.close();
        System.out.println("应用程序已关闭");
    }
}